/**
 * 容器组件示例
 */
const { connect } = ReactRedux

/**
 * 主页组件
 */
class Home extends React.Component {
    render() {
        return (
            <div className="home-container">容器组件</div>
        )
    }
}
/**
 * 获取reducier
 * @params:{state}
 */
const mapStateToProps = (state) => {
    return {
        count: state
    }
}

/**
 * 获取reducier
 * @params:{state}
 */
const mapDispatchToProps = (dispatch) => {
    return {

    }
}

/**
 * 这个两个参数有先后顺序
 */
const HomeComponent = connect(mapStateToProps, mapDispatchToProps)(Home)
console.log("HomeComponent", HomeComponent)

/**
    * rect-redux第一种做法:
    ReactDOM.render(
        <Provider store={ store }>
            <App onIncrement={() => store.dispatch({type:'increment'})} 
                onDecrement={() => store.dispatch({type:'decrement'})}
                value={store.getState()}/>
        </Provider>,
    document.body);
    */